package com.huawei.appmarket.service.store.awk.card;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.cgz;
import o.cht$d;
import o.chy;
import o.dof;
import o.MinimumFactory;
import o.ewm.j;

public class TitleCard extends BaseDistCard {
    private int ʻ = 0;
    private ImageView ʽ;
    private TextView ˋ;

    public TitleCard(Context context) {
        super(context);
    }

    protected TextView ˎ() {
        return this.ˋ;
    }

    protected ImageView ˋ() {
        return this.ʽ;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (TextUtils.isEmpty(this.ˊᐝ.ॱॱ())) {
            this.ˋ.setVisibility(8);
            this.ʽ.setVisibility(8);
            return;
        }
        this.ˋ.setVisibility(0);
        this.ʽ.setVisibility(0);
        if (!dof.ˋ(this.ˊᐝ.O_())) {
            this.ˋ.setText(this.ˊᐝ.O_());
        }
        if (this.ʻ == 3) {
            this.ˋ.setVisibility(8);
            this.ʽ.setVisibility(8);
        }
    }

    public cgz ˏ(View view) {
        ॱ((TextView) view.findViewById(j.ʼﾞ));
        this.ˋ = (TextView) view.findViewById(j.ʽˈ);
        this.ʽ = (ImageView) view.findViewById(j.ʼꜞ);
        ʽ(view);
        if (MinimumFactory.getBoolValue(view.getContext())) {
            ˊˋ().setGravity(5);
        } else {
            ˊˋ().setGravity(3);
        }
        return this;
    }

    public void ॱ(chy o_chy) {
        OnClickListener o_cht_d = new cht$d(o_chy, this);
        this.ˋ.setOnClickListener(o_cht_d);
        this.ʽ.setOnClickListener(o_cht_d);
    }
}
